FROM centos:7.9.2009
MAINTAINER "zhangyw<alemcity@foxmail.com>"

# set environment
ENV BASE_DIR="/zxserver" \
    CLASSPATH=".:/home/gauthd/lib:$CLASSPATH" \
    JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk" \
    JAVA="/usr/lib/jvm/java-1.8.0-openjdk/bin/java" \
    TIME_ZONE="Asia/Shanghai"

RUN set -x \
    && yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel \ 
    && yum clean all \
    && ln -snf /usr/share/zoneinfo/$TIME_ZONE /etc/localtime && echo $TIME_ZONE > /etc/timezone

RUN mkdir -p $BASE_DIR && \ 
    mkdir -p $BASE_DIR/logs

ADD ./etc/cert.jks /etc/
ADD ./zxserver/gauthd $BASE_DIR/gauthd

COPY ./config/gauthd/authd.conf $BASE_DIR/gauthd/authd.conf
COPY ./config/gauthd/table.xml $BASE_DIR/gauthd/table.xml

WORKDIR $BASE_DIR/gauthd

# 29200 auth 29206 vip
EXPOSE 29200 29206

CMD ["java","-Dlog4j.configuration=./log4j.properties","-jar","authd.jar","table.xml"]
